<script setup lang="ts"></script>

<template>
  <div class="layer-control">
    <div class="layers">
      <slot></slot>
    </div>
  </div>
</template>

<style lang="scss">
.layer-control {
  --default-color: #c8d6e5;
  --checked-color: #706fd3;
  display: flex;

  .layers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    border-radius: 4px;
    color: #fff;
    background-color: rgba(#222f3e, 0.85);

    &__item {
      position: relative;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 20px 20px 8px;

      &__check {
        position: absolute;
        left: 5px;
        top: 5px;
        display: block;
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: var(--default-color);
        cursor: pointer;
        transition: background-color 0.15s ease-in-out;

        &--checked {
          background-color: var(--checked-color);
        }

        &--loading {
          animation: pulse 0.5s infinite alternate;
        }
      }

      &__icon {
        width: 32px;
        height: 32px;
        margin-bottom: 5px;
        border-radius: 4px;
        background-color: var(--default-color);
        cursor: pointer;
        transition: background-color 0.15s ease-in-out;

        &--checked {
          background-color: var(--checked-color);
        }

        &--loading {
          animation: pulse 0.5s infinite alternate;
        }
      }

      &__label {
        font-size: 12px;
      }
    }
  }
}
</style>
